﻿<!DOCTYPE HTML>
<html>
<head>
    <title>充值</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="http://g.alicdn.com/bui/bui/1.1.21/css/bs3/dpl.css" rel="stylesheet">
    <link href="http://g.alicdn.com/bui/bui/1.1.21/css/bs3/bui.css" rel="stylesheet">
    <link href="../assets/css/page-min.css" rel="stylesheet" type="text/css" />
        <link href="../assets/css/prettify.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        code {
            padding: 0px 4px;
            color: #d14;
            background-color: #f7f7f9;
            border: 1px solid #e1e1e8;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="row">
            <form id="searchForm" class="form-horizontal span24">
                <div class="row">
                    <div class="control-group span12">
                        <label class="control-label">充值时间：</label>
                        <div class="controls">
                            <input type="text" class="calendar" name="startDate"><span> - </span><input name="endDate" type="text" class="calendar">
                        </div>
                    </div>
                    <div class="span3 offset2">
                        <button type="submit" id="btnSearch" class="button button-primary">搜索</button>
                    </div>
                </div>
            </form>
        </div>
        <div class="search-grid-container">
            <div id="grid"></div>
        </div>
    </div>
    <script type="text/javascript" src="~/assets/js/jquery-1.8.1.min.js"></script>
    <script type="text/javascript" src="~/assets/js/bui-min.js"></script>
    <script type="text/javascript" src="~/assets/js/config-min.js"></script>
    <script type="text/javascript">
        BUI.use('common/page');
    </script>
    <script src="http://g.tbcdn.cn/fi/bui/bui-min.js?t=201309041336"></script>
    <script type="text/javascript">
        var Grid = BUI.Grid,
            Store = BUI.Data.Store,
            columns = [
                { title: '编号', width: 100, sortable: false, dataIndex: 'no' },
                { title: '金额', width: 100, sortable: true, dataIndex: 'amount' },
                {
                    title: '赠金', width: 150, sortable: false, dataIndex: 'zamount'
                },
                { title: '时间', width: 100, sortable: true, dataIndex: 'date' },
                { title: '备注', width: 100, sortable: true, dataIndex: 'remark' }
            ];

        var store = new Store({
            url: '/recharge/list',
            autoLoad: true,
            pageSize: 10
        }),
            grid = new Grid.Grid({
                render: '#grid',
                loadMask: true,
                forceFit: true,
                columns: columns,
                store: store,
                plugins: [ Grid.Plugins.AutoFit], //勾选插件、自适应宽度插件

                // 顶部工具栏
                bbar: {
                    //items 也可以在此配置
                    // pagingBar:表明包含分页栏
                    pagingBar: true
                }
            });

        grid.render();

        var form = new BUI.Form.HForm({
            srcNode: '#searchForm'
        }).render();

        form.on('beforesubmit', function (ev) {
            //序列化成对象
            var obj = form.serializeToObject();
            obj.start = 0; //返回第一页
            store.load(obj);
            return false;
        });
    </script>

</body>
</html>
